<template>
  <el-select placeholder="请选择" v-model="form.channel_id">
    <!-- <el-select placeholder="请选择" v-model="value"> -->
    <el-option
      v-for="item in this.$store.state.channelsList"
      :key="item.id"
      :label="item.name"
      :value="item.id"
    ></el-option>
  </el-select>
</template>

<script>
import { channels } from '@/api/index.js'
export default {
  props: ['form'],
  // props:['value'],
  data () {
    return {
      channelsList: []
    }
  },
  async created () {
    if(this.$store.state.channelsList.length === 0){
      const res = await channels()
      this.$store.commit('setList',res.data.channels)
    }
  }
  /*
   // 监听value值的改变/change事件  触发this.$emit 向父组件传值
  watch:{
      value:{
          handler(newVal){
              this.$emit('input',newVal)
          }
      }
  } 
  */
}
</script>

<style></style>
